import React, {Component} from 'react';
import './../App.scss';
import Icon from '@material-ui/core/Icon';
import Avatar from '@material-ui/core/Avatar';
import AssignmentIcon from '@material-ui/icons/Assignment';
class ItemList extends Component {
    state = {};

    componentDidMount() {
        // console.log(this.props.msg)
    }
    componentWillUnmount() {}
    render() {
        return (
            <div className="itemlist">
                <div className="lists">
                    <img src="http://d.ifengimg.com/mw978_mh598/p2.ifengimg.com/cmpp/2018/07/18/22/998053f1-4750-47e6-a683-3f9d32167467_size49_w1024_h683.jpg" alt=""/>
                    <div>
                        <div className="right_top1">
                            <span className="num">{this.props.msg.num}</span>
                            <div>
                                <AssignmentIcon color="primary" onClick={this.props.onSetting}/>
                                <Icon color="primary" onClick = {this.props.onDelet}>
                                    delete_forever
                                </Icon>
                            </div>
                        </div>
                        {
                            this.props.msg.issurp?(
                                <span className="surp">已售300头，剩余100头</span>
                            ):null
                        }
                        <span className="name">绵阳三台希望猪场</span>
                        <div className = "right_bot">
                            <span>地址:</span>
                            <span>四川省德阳三台</span>
                        </div>
                        <div className = "right_bot">
                            <span>价格:</span>
                            <div>
                                <span>$18.22元/kg（均重100-110KG）</span>
                                <span>$18.22元/kg（均重110-120KG）</span>
                                <span>$18.22元/kg（均重120KG以上）</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        );
    }
}
export default ItemList;